<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{$person}</title>
    {include file="inset/head/head_css.tpl"}
    {include file="inset/head/head_js.tpl"}
</head>
<body>
    	
   <div class="b-popup none">
    <div class="showp" style="margin:10% auto;text-align: center;"></div>
     <div class="b-popup-content">
	<div class="b-popup-header" align="right"><img id="close_popap" src="/static/img/toolbar/close-tab.png" width="20px"/></div>
	<form enctype="multipart/form-data" action="/storage/upload" id="fileupload">
	    <div class="new_product">
		<div><label>Файл:</label></div>
		<div>
		    <input type="file" name="userfile" multiple>	
		</div>
		<div id="progress" class="progress">
		    <div class="progress-bar"></div>
		</div>
	    </div>
	</form>
	<div id="files"></div>
	<div id="error"></div>
	<form>
	    <div class="new_product">
		<div><label>Категория:</label></div>
		<div>
		    <select class="validate[required]" id="product_category">
			<option></option>
			{for  $i=0 to $category|@count-1}
			    <option value="{$category.$i.id}">{$category.$i.name}</option>
			{/for}
		    </select>	
		</div>	
	    </div>
	    <div class="new_product id_fabricator_product">
		<div><label>Призводитель:</label></div>
		<div>
		    <select class="validate[groupRequired[payments]]" id="id_fabricator_product">
			<option value=""></option>
			{for  $i=0 to $fabricator|@count-1}
			    <option value="{$fabricator.$i.id}">{$fabricator.$i.name}</option>
			{/for}
		    </select>	
		</div>	
	    </div>
	    <div class="new_product fabricator_new">
		<div><label>Новый пр-ль:</label></div>
		<div><input type="text" class="validate[groupRequired[storage]]" id="fabricator_product" name="fabricator"/></div>
	    </div>
	    <div class="new_product">
		<div><label>Название:</label></div>
		<div><input type="text" id="name_product" class="validate[storage]" name="name"/></div>	
	    </div>
	    <div class="new_product">
		<div><label>Колличество:</label></div>	
		<div><input type="text" id="count_product" class="validate[required],custom[integer]" name="count"/></div>	
	    </div>
	    <div class="new_product">
		<div><label>В наличии:</label></div>	
		<div><input type="text" id="count_stock_product" name="count_stock" class="validate[required],custom[integer]" value="0"/></div>	
	    </div>
	    <div class="new_product">
		<div><label>Зарезервировано:</label></div>	
		<div><input type="text" id="reserved_product" name="reserved"  class="validate[required],custom[integer]" value="0"/></div>	
	    </div>
	    <div class="new_product">
		<div><label>Цена:</label></div>	
		<div><input type="text" id="price_product"  class="validate[required],custom[number]" name="price"/></div>	
	    </div>
	    <div class="new_product">
		<div><label>Комментарии:</label></div>	
		<div><input type="text" id="comments_product"  name="comments"/></div>	
	    </div>
	    <div class="product_submit">
	    <input id="path" type="hidden" value=""/>
	    <input id="product_submit" type="button" value="Сохранить"/>
	    </div>
	</form>
     </div>
   </div>	
    <div class="wrapper">
        {include file="inset/header.tpl"}
        
        {include file="inset/menu/vermenu.tpl"}
	
        <div class="content">
	    <div class="navigation">
		<div class="product_navigation">
		<form action="/storage/find/" method="get" id="client_form">
		    <ul>
		     <li>
			<div id="storage_button" class="button">
			    Добавить товар	
			</div>
		    </li>
		    <li>
			<label>Категория</label>
			<select id="find_product_category" name="id_category">
			    <option value="">Выберите категорию</option>
			    {for  $i=0 to $category|@count-1}
				<option value="{$category.$i.id}">{$category.$i.name}</option>
			    {/for}
			</select>
		    </li>
		    <li>
			<label>Производитель</label>
			<select name="id_fabricator">
			    <option value="">Выберите производителя</option>
			    {for  $i=0 to $fabricator|@count-1}
				<option value="{$fabricator.$i.id}">{$fabricator.$i.name}</option>
			    {/for}
			</select>
		    </li>	
		    <li><input type="submit" value="найти"/></li>
		   </ul>
		</form>
		</div><!--client_navigation-->
	    </div><!--navigation-->
	    <table style="word-wrap: break-word" class="storage_table" cellspacing="0" cellpadding="0">
	        <tr>
		    <th width="10%">
		        Категория
                    </th>
                    <th width="5%">
		        Код
                    </th>
	            <th width="7%">
		        Фото
                    </th>
		    <th width="14%">
		        Товар
		    </th>
		    <th width="10%">
		        Количество
		    </th>
		    <th width="10%">
		        На складе
		    </th>
		    <th width="8%">
		        Зарезервированно
		    </th>
		    <th width="12%">
		        Комментарии
		    </th>
		    <th width="12%">
		        Производитель
		    </th>
		    <th width="2%">
		         Удть
		    </th>
		    <th width="12%">
		        Создатель
		    </th>
	        </tr>
                {if isset($storage)}
                {for $i=0 to $storage|@count-1}
		<tr>
                    <td>
                        <p>{$storage.$i.category}</p>
                    </td>
		    <td>
			<p><a href="/someproduct/index/{$storage.$i.id}">{$storage.$i.id}</a></p>
		    </td>
		    <td>
			<p>
			    {if $storage.$i.path_img !=""}
			    <img class="showpicture" src="{$storage.$i.path_img}" width="70px" height="70px"/>
			    {/if}
			</p>
		    </td>
		    <td>
			<p>{$storage.$i.name}</p>
		    </td>
		    <td>
			<p>{$storage.$i.count}</p>
		    </td>
		    <td>
			<p>{$storage.$i.count_stock}</p>
		    </td>
		    <td>
			<p>{$storage.$i.reserved}</p>
		    </td>
		    <td>
			<p><b>{$storage.$i.comments}</b></p>
		    </td>
		    <td>
			<p>{$storage.$i.fabricator}</p>
		    </td>
		     <td>
			<p><a  onclick='if (confirm("Удалить?")) {  window.location ="/storage/delete/{$storage.$i.id}";}' href="#" >X</a></p>
		    </td>
		    <td>
			<p>{$storage.$i.person}</p>
		    </td>
		</tr>
		{/for}
                <tr>
                    <td colspan="11" class="pages"><div > <p >{$pages}</p></div></td>
                </tr>
                {/if}
                {if isset($error)}
                <tr>
                    <td colspan="10">{$error.error}</td>
                </tr>
                {/if}
	    </table>
           
	</div>
    </div>
    {include file="inset/footer.tpl"}
</body>
</html>
